#!/usr/bin/env python
#Python based output device, used to send output over rs-whatever to the embedded net
'''
Code to handle outputing to a device that is on the embbedded network
TODO:
	Spec out the sturcture of the embedded net to figure out the best archeciture of this code
	Figure out a abstract way of outputing the commands from an output controller
'''
import serial

class outputDevice(object):
	'''
	Transforms the ros message into something to output to the embedded net 
	'''
	def __init__(self,transformer=rosTransformer):
		self.command=""
		self.transformer=rosTransformer
	def write(self):
		self.command=self.parseTransformer()
		serial.write(self.command)
	def listen(self):
		'''Listen to ROS'''
		pass
	def parseTransformer(self):
		pass

class rosTransformer(object):
	'''
	Transforms the ros message into something to output to the embedded net 
	'''
	def __init__(self):
		self.heading={'vy':0,'vx':0,'vt':0}
	def transform(self,message):
		pass
	def parseMessage(self,message):
		pass 
	def write(self):
		out=""
		for h in heading:
			out-out+h+heading[h]
		return out
